package com.sslpay.merchant.service;

import com.sslpay.common.domain.BusinessException;
import com.sslpay.common.domain.CommonErrorCode;
import com.sslpay.merchant.api.AppService;
import com.sslpay.merchant.api.dto.AppDTO;
import com.sslpay.merchant.entity.Merchant;
import com.sslpay.merchant.mapper.MerchantMapper;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 描述：
 *
 * @author ssl
 * @create 2020/05/11 16:07
 */
@org.apache.dubbo.config.annotation.Service
public class AppServiceImpl implements AppService {
    @Autowired
    private MerchantMapper merchantMapper;

    /**
     * 创建应用
     *
     * @param merchantId
     * @param appDTO
     * @return
     */
    @Override
    public AppDTO createApp(Long merchantId, AppDTO appDTO) throws BusinessException {
        // 检查商户是否通过资质申请
        if (null == merchantId) {
            throw new BusinessException(CommonErrorCode.E_200019);
        }
        Merchant merchant = merchantMapper.selectById(merchantId);
        return null;
    }
}
